0b4dc644eaa93687023844e6579ee7699ddede69,tests/frontend/org/voltdb/regressionsuites/LocalCluster.java,LocalCluster,LocalCluster,#String#number#number#number#BackendTarget#FailureState#boolean#boolean#Map#,189
Before Change
assert (siteCount > 0);
assert (hostCount > 0);
m_additionalProcessEnv = env;
// get the name of the calling class
StackTraceElement[] traces = Thread.currentThread().getStackTrace();
m_callingClassName = "UnknownClass";
m_callingMethodName = "unknownMethod";
//ArrayUtils.reverse(traces);
int i;
// skip all stack frames below this method
for (i = 0; traces[i].getClassName().equals(getClass().getName()) == false; i++);
// skip all stack frames from localcluster itself
for (; traces[i].getClassName().equals(getClass().getName()); i++);
// skip the package name
int dot = traces[i].getClassName().lastIndexOf('.');
m_callingClassName = traces[i].getClassName().substring(dot + 1);
m_callingMethodName = traces[i].getMethodName();
log.info("Instantiating LocalCluster for " + jarFileName + " with class.method: " +
m_callingClassName + "." + m_callingMethodName);
log.info("Sites: " + siteCount + " hosts: " + hostCount + " replication factor: " + kfactor);
m_cluster.ensureCapacity(hostCount);
m_siteCount = siteCount;
m_hostCount = hostCount;
if (kfactor > 0 && !MiscUtils.isPro()) {
m_kfactor = 0;
} else {
m_kfactor = kfactor;
}
m_debug = debug;
m_jarFileName = jarFileName;
m_failureState = m_kfactor < 1 ? FailureState.ALL_RUNNING : failureState;
m_pipes = new ArrayList<PipeToFile>();
m_cmdLines = new ArrayList<CommandLine>();
// if the user wants valgrind and it makes sense, give it to 'em
// For now only one host works.
if (isMemcheckDefined() && (target == BackendTarget.NATIVE_EE_JNI) && m_hostCount == 1) {
m_target = BackendTarget.NATIVE_EE_VALGRIND_IPC;
}
else {
m_target = target;
}
String buildDir = System.getenv("VOLTDB_BUILD_DIR"); // via build.xml
if (buildDir == null) {
buildDir = System.getProperty("user.dir") + "/obj/release";
}
String classPath = System.getProperty("java.class.path") + ":" +
buildDir + File.separator + m_jarFileName;
String javaLibraryPath = null;
if (m_additionalProcessEnv != null && m_additionalProcessEnv.containsKey(EELibraryLoader.USE_JAVA_LIBRARY_PATH)) {
if (Boolean.parseBoolean(m_additionalProcessEnv.get(EELibraryLoader.USE_JAVA_LIBRARY_PATH))) {
// set the java lib path to the one for this process - Add obj/release/nativelibs
javaLibraryPath = System.getProperty("java.library.path");
if (javaLibraryPath == null || javaLibraryPath.trim().length() == 0) {
javaLibraryPath = buildDir + "/nativelibs";
} else {
javaLibraryPath += ":" + buildDir + "/nativelibs";
}
}
}
if (javaLibraryPath==null) {
// need this in classpath to find native library. Otherwise, don't add it to classpath to
// test override of loading EE lib from jar.
classPath = classPath + ":" + buildDir + File.separator + "prod";
}
// Remove the stored procedures from the classpath. Out-of-process nodes will
After Change
assert (siteCount > 0);
assert (hostCount > 0);
m_additionalProcessEnv = env==null ? new HashMap<String, String>() : env;
if (Boolean.getBoolean(EELibraryLoader.USE_JAVA_LIBRARY_PATH)) {
// set use.javalib for LocalCluster so that Eclipse runs will be OK.
m_additionalProcessEnv.put(EELibraryLoader.USE_JAVA_LIBRARY_PATH, "true");
}
// get the name of the calling class
StackTraceElement[] traces = Thread.currentThread().getStackTrace();
m_callingClassName = "UnknownClass";
m_callingMethodName = "unknownMethod";
//ArrayUtils.reverse(traces);
int i;
// skip all stack frames below this method
for (i = 0; traces[i].getClassName().equals(getClass().getName()) == false; i++);
// skip all stack frames from localcluster itself
for (; traces[i].getClassName().equals(getClass().getName()); i++);
// skip the package name
int dot = traces[i].getClassName().lastIndexOf('.');
m_callingClassName = traces[i].getClassName().substring(dot + 1);
m_callingMethodName = traces[i].getMethodName();
log.info("Instantiating LocalCluster for " + jarFileName + " with class.method: " +
m_callingClassName + "." + m_callingMethodName);
log.info("Sites: " + siteCount + " hosts: " + hostCount + " replication factor: " + kfactor);
m_cluster.ensureCapacity(hostCount);
m_siteCount = siteCount;
m_hostCount = hostCount;
if (kfactor > 0 && !MiscUtils.isPro()) {
m_kfactor = 0;
} else {
m_kfactor = kfactor;
}
m_debug = debug;
m_jarFileName = jarFileName;
m_failureState = m_kfactor < 1 ? FailureState.ALL_RUNNING : failureState;
m_pipes = new ArrayList<PipeToFile>();
m_cmdLines = new ArrayList<CommandLine>();
// if the user wants valgrind and it makes sense, give it to 'em
// For now only one host works.
if (isMemcheckDefined() && (target == BackendTarget.NATIVE_EE_JNI) && m_hostCount == 1) {
m_target = BackendTarget.NATIVE_EE_VALGRIND_IPC;
}
else {
m_target = target;
}
String buildDir = System.getenv("VOLTDB_BUILD_DIR"); // via build.xml
if (buildDir == null) {
buildDir = System.getProperty("user.dir") + "/obj/release";
}
String classPath = System.getProperty("java.class.path") + ":" +
buildDir + File.separator + m_jarFileName + ":" + buildDir + File.separator + "prod";
// set the java lib path to the one for this process - Add obj/release/nativelibs
String javaLibraryPath = System.getProperty("java.library.path");
if (javaLibraryPath == null || javaLibraryPath.trim().length() == 0) {
javaLibraryPath = buildDir + "/nativelibs";
} else {